﻿@model BMS.ViewModels.OrderModelList

@{
    ViewBag.Title = "Order Confirmation";
}

@section featured {
    <section class="featured">
        <div class="content-wrapper" align="center">
            <hgroup class="title">
                <h1>@ViewBag.Message</h1>
            </hgroup>
        </div>
    </section>
}

<section>
    @using (Html.BeginForm())
    {
        @Html.ValidationSummary(true)

        if (Model.InsertionSuccessfulFlag == true)
        {
            <div align="center">The following orders are created successfully!</div>
            <br align="center" />
            <table align="center" border="1">
                <thead>
                    <tr>
                        <th width="50">@Html.LabelFor(m => m.order.FMName)</th>
                        <th width="100">@Html.LabelFor(m => m.order.ServiceOrderNo)</th>
                        <th width="200">@Html.LabelFor(m => m.order.Location)</th>
                        <th width="200">@Html.LabelFor(m => m.order.City)</th>
                        <th width="200">@Html.LabelFor(m => m.order.Description)</th>
                        <th width="100">@Html.LabelFor(m => m.order.WorkOrderNo)</th>
                        <th width="50">@Html.LabelFor(m => m.order.Emergency)</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model.orderList)
                    {
                        <tr>
                            <td align="center">@item.FMName</td>
                            <td align="center">@item.ServiceOrderNo</td>
                            <td align="center">@item.Location</td>
                            <td align="center">@item.City</td>
                            <td align="center">@item.Description</td>
                            <td align="center">@item.WorkOrderNo</td>
                            <td align="center">@item.Emergency</td>
                        </tr>
                    }
                </tbody>
            </table>
        }
        else if (Model.InsertionSuccessfulFlag == false)
        {
            <div align="center">The following orders are created unsuccessfully!</div>
            <br align="center" />
            <table align="center" border="1">
                <thead>
                    <tr>
                        <th width="50">@Html.LabelFor(m => m.order.FMName)</th>
                        <th width="100">@Html.LabelFor(m => m.order.ServiceOrderNo)</th>
                        <th width="200">@Html.LabelFor(m => m.order.Location)</th>
                        <th width="200">@Html.LabelFor(m => m.order.Description)</th>
                        <th width="100">@Html.LabelFor(m => m.order.WorkOrderNo)</th>
                        <th width="50">@Html.LabelFor(m => m.order.Emergency)</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model.orderList)
                    {
                        <tr>
                            <td align="center">@item.FMName</td>
                            <td align="center">@item.ServiceOrderNo</td>
                            <td align="center">@item.Location</td>
                            <td align="center">@item.Description</td>
                            <td align="center">@item.WorkOrderNo</td>
                            <td align="center">@item.Emergency</td>
                        </tr>
                    }
                </tbody>
            </table>
        }
    }
</section>



<section>
    @using (Html.BeginForm("BackToMainMeun", "Home"))
    {
        <br align="center" />
        <input type="submit" value="Back To Main Menu" />
    }
</section>
